/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.easoftware.code.beans.jpa;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import net.easoftware.code.beans.maintenance.annotation.DataTableColumn;
import org.eclipse.persistence.annotations.NamedStoredProcedureQuery;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 *
 * @author waumovil-javaengineer
 */
@Entity
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Table(name = "ventaca_store")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "VentacaStore.findAll", query = "SELECT v FROM VentacaStore v"),
    @NamedQuery(name = "VentacaStore.findById", query = "SELECT v FROM VentacaStore v WHERE v.id = :id"),
    @NamedQuery(name = "VentacaStore.findByCompania", query = "SELECT v FROM VentacaStore v WHERE v.compania = :compania"),
    @NamedQuery(name = "VentacaStore.findByNodocto", query = "SELECT v FROM VentacaStore v WHERE v.nodocto = :nodocto"),
    @NamedQuery(name = "VentacaStore.findByTdocto", query = "SELECT v FROM VentacaStore v WHERE v.tdocto = :tdocto"),
    @NamedQuery(name = "VentacaStore.findByFecha", query = "SELECT v FROM VentacaStore v WHERE v.fecha = :fecha"),
    @NamedQuery(name = "VentacaStore.findByNit", query = "SELECT v FROM VentacaStore v WHERE v.nit = :nit"),
    @NamedQuery(name = "VentacaStore.findByCodigo", query = "SELECT v FROM VentacaStore v WHERE v.codigo = :codigo"),
    @NamedQuery(name = "VentacaStore.findByCodigo2", query = "SELECT v FROM VentacaStore v WHERE v.codigo2 = :codigo2"),
    @NamedQuery(name = "VentacaStore.findByNombre", query = "SELECT v FROM VentacaStore v WHERE v.nombre = :nombre"),
    @NamedQuery(name = "VentacaStore.findByRazonsocial", query = "SELECT v FROM VentacaStore v WHERE v.razonsocial = :razonsocial"),
    @NamedQuery(name = "VentacaStore.findByMonto", query = "SELECT v FROM VentacaStore v WHERE v.monto = :monto"),
    @NamedQuery(name = "VentacaStore.findByZonaventa", query = "SELECT v FROM VentacaStore v WHERE v.zonaventa = :zonaventa"),
    @NamedQuery(name = "VentacaStore.findByRepventas", query = "SELECT v FROM VentacaStore v WHERE v.repventas = :repventas"),
    @NamedQuery(name = "VentacaStore.findBySegmento", query = "SELECT v FROM VentacaStore v WHERE v.segmento = :segmento"),
    @NamedQuery(name = "VentacaStore.findByRprmk", query = "SELECT v FROM VentacaStore v WHERE v.rprmk = :rprmk"),
    @NamedQuery(name = "VentacaStore.findByRpdctm01", query = "SELECT v FROM VentacaStore v WHERE v.rpdctm01 = :rpdctm01"),
    @NamedQuery(name = "VentacaStore.findByTipocredito", query = "SELECT v FROM VentacaStore v WHERE v.tipocredito = :tipocredito"),
    @NamedQuery(name = "VentacaStore.findByCondcredito", query = "SELECT v FROM VentacaStore v WHERE v.condcredito = :condcredito"),
    @NamedQuery(name = "VentacaStore.findByRpatxa", query = "SELECT v FROM VentacaStore v WHERE v.rpatxa = :rpatxa"),
    @NamedQuery(name = "VentacaStore.findByRpatxn", query = "SELECT v FROM VentacaStore v WHERE v.rpatxn = :rpatxn"),
    @NamedQuery(name = "VentacaStore.findByRpstam", query = "SELECT v FROM VentacaStore v WHERE v.rpstam = :rpstam")})
@NamedStoredProcedureQuery(  
    name = "procesarVentas",
procedureName = "procesarVentas",
returnsResultSet = false)
public class VentacaStore implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @DataTableColumn(order = 1, title = "Compania", name = "compania")
    @Column(name = "compania")
    private Integer compania;
    @DataTableColumn(order = 2, title = "No. Docto.", name = "nodocto")
    @Size(max = 45)
    @Column(name = "nodocto")
    private String nodocto;
    @DataTableColumn(order = 3, title = "Tipo Docto.", name = "tdocto")
    @Size(max = 45)
    @Column(name = "tdocto")
    private String tdocto;
    @Column(name = "fecha")
    @Temporal(TemporalType.DATE)
    private Date fecha;
    @DataTableColumn(order = 4, title = "Nit", name = "nit")
    @Size(max = 45)
    @Column(name = "nit")
    private String nit;
    @DataTableColumn(order = 5, title = "Codigo", name = "codigo")
    @Column(name = "codigo")
    private Integer codigo;
    @Column(name = "codigo2")
    private Integer codigo2;
    @DataTableColumn(order = 6, title = "Nombre", name = "nombre")
    @Size(max = 100)
    @Column(name = "nombre")
    private String nombre;
    @DataTableColumn(order = 7, title = "Razon Social", name = "razonsocial")
    @Size(max = 100)
    @Column(name = "razonsocial")
    private String razonsocial;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "monto")
    private Double monto;
    @Size(max = 10)
    @Column(name = "zonaventa")
    private String zonaventa;
    @Size(max = 45)
    @Column(name = "repventas")
    private String repventas;
    @Size(max = 45)
    @Column(name = "segmento")
    private String segmento;
    @Size(max = 45)
    @Column(name = "rprmk")
    private String rprmk;
    @Size(max = 45)
    @Column(name = "rpdctm01")
    private String rpdctm01;
    @Size(max = 45)
    @Column(name = "tipocredito")
    private String tipocredito;
    @Size(max = 45)
    @Column(name = "condcredito")
    private String condcredito;
    @Column(name = "rpatxa")
    private Double rpatxa;
    @Column(name = "rpatxn")
    private Double rpatxn;
    @Column(name = "rpstam")
    private Double rpstam;
    @Column(name = "unidadnegocio")
    private Integer unidadnegocio;
    @Column(name = "lineanegocio")
    private Integer lineanegocio;
    @JoinColumn(name = "cargadatos", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Cargadatos cargadatos;

    public VentacaStore() {
    }

    public VentacaStore(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getCompania() {
        return compania;
    }

    public void setCompania(Integer compania) {
        this.compania = compania;
    }

    public String getNodocto() {
        return nodocto;
    }

    public void setNodocto(String nodocto) {
        this.nodocto = nodocto;
    }

    public String getTdocto() {
        return tdocto;
    }

    public void setTdocto(String tdocto) {
        this.tdocto = tdocto;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public String getNit() {
        return nit;
    }

    public void setNit(String nit) {
        this.nit = nit;
    }

    public Integer getCodigo() {
        return codigo;
    }

    public void setCodigo(Integer codigo) {
        this.codigo = codigo;
    }

    public Integer getCodigo2() {
        return codigo2;
    }

    public void setCodigo2(Integer codigo2) {
        this.codigo2 = codigo2;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getRazonsocial() {
        return razonsocial;
    }

    public void setRazonsocial(String razonsocial) {
        this.razonsocial = razonsocial;
    }

    public Double getMonto() {
        return monto;
    }

    public void setMonto(Double monto) {
        this.monto = monto;
    }

    public String getZonaventa() {
        return zonaventa;
    }

    public void setZonaventa(String zonaventa) {
        this.zonaventa = zonaventa;
    }

    public String getRepventas() {
        return repventas;
    }

    public void setRepventas(String repventas) {
        this.repventas = repventas;
    }

    public String getSegmento() {
        return segmento;
    }

    public void setSegmento(String segmento) {
        this.segmento = segmento;
    }

    public String getRprmk() {
        return rprmk;
    }

    public void setRprmk(String rprmk) {
        this.rprmk = rprmk;
    }

    public String getRpdctm01() {
        return rpdctm01;
    }

    public void setRpdctm01(String rpdctm01) {
        this.rpdctm01 = rpdctm01;
    }

    public String getTipocredito() {
        return tipocredito;
    }

    public void setTipocredito(String tipocredito) {
        this.tipocredito = tipocredito;
    }

    public String getCondcredito() {
        return condcredito;
    }

    public void setCondcredito(String condcredito) {
        this.condcredito = condcredito;
    }

    public Double getRpatxa() {
        return rpatxa;
    }

    public void setRpatxa(Double rpatxa) {
        this.rpatxa = rpatxa;
    }

    public Double getRpatxn() {
        return rpatxn;
    }

    public void setRpatxn(Double rpatxn) {
        this.rpatxn = rpatxn;
    }

    public Double getRpstam() {
        return rpstam;
    }

    public void setRpstam(Double rpstam) {
        this.rpstam = rpstam;
    }

    public Cargadatos getCargadatos() {
        return cargadatos;
    }

    public void setCargadatos(Cargadatos cargadatos) {
        this.cargadatos = cargadatos;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += ( id != null ? id.hashCode() : 0 );
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!( object instanceof VentacaStore )) {
            return false;
        }
        VentacaStore other = (VentacaStore) object;
        if (( this.id == null && other.id != null ) || ( this.id != null && !this.id.equals(other.id) )) {
            return false;
        }
        return true;
    }

    public Integer getUnidadnegocio() {
        return unidadnegocio;
    }

    public void setUnidadnegocio(Integer unidadnegocio) {
        this.unidadnegocio = unidadnegocio;
    }

    public Integer getLineanegocio() {
        return lineanegocio;
    }

    public void setLineanegocio(Integer lineanegocio) {
        this.lineanegocio = lineanegocio;
    }

    @Override
    public String toString() {
        return "net.easoftware.code.beans.jpa.VentacaStore[ id=" + id + " ]";
    }
}
